"""
---------------------------------------------------------------------
- File: login.py
- Date: 2025/11/18
- Author: yangzhide
- Email: xxzjyzd@126.com
- Description: 登录相关的SQLModel
---------------------------------------------------------------------
"""

from sqlmodel import Field, SQLModel


class Token(SQLModel):
    access_token: str = Field(description="token")
    token_type: str = Field(description="token类型")


class UserLogin(Token):
    code: int = Field(default=200, description="状态码")
    message: str = Field(default="成功", description="提示信息")
    data: Token = Field(description="token信息")


class AuthenticatedUser(SQLModel):
    """
    当前请求用户信息, 便于logs记录
    """

    id: int | None = Field(None, description="用户ID")
    user_no: str | None = Field(None, description="用户编号")
    user_name: str | None = Field(None, description="用户名")
